package com.arpa.wms.domain.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;

/**
 * 调拨单状态 枚举类型
 * @author jinss
 * @date 2020-12-16 10:45:29
 **/
public enum AllocationStatusEnum implements IEnum<String> {
    /**
     * 调拨单状态
     */
    NEW("0", "新增"),
    WAIT_AUDIT("1", "待审核"),
    PASS("2", "审核通过"),
    REJECTED("3", "审核不通过"),
    INVALID("4", "作废")
    ;

    /**
     * 值
     */
    private final String value;

    /**
     * 描述
     */
    private final String desc;

    /**
     * 初始化属性信息
     */
    AllocationStatusEnum(final String value, final String desc) {
        this.value = value;
        this.desc = desc;
    }

    /**
     * 根据描述，反向查找第一个符合的枚举对象
     *
     * @param value
     * @return
     */
    public static AllocationStatusEnum getByValue(String value) {
        for (AllocationStatusEnum item : values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return null;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    @Override
    public String toString(){
        return this.desc;
    }

    public String getDesc() {
        return this.desc;
    }
}
